import { Component, OnInit, Input } from '@angular/core'
import { DetailBaseClass } from '@shared/classes/DetailBaseClass'
import { RiskControlScheme } from '@shared/interfaces/risk-control'
import { I18NService } from '@core'
import { Router, ActivatedRoute } from '@angular/router'
import { TitleService } from '@delon/theme'
import { PageService } from '@shared/services/page.service'

@Component({
  selector: 'app-task-risk-info',
  templateUrl: './risk-info.component.html',
})
export class TaskRiskInfoComponent extends DetailBaseClass<RiskControlScheme> implements OnInit {
  @Input() riskControlScheme: RiskControlScheme

  constructor(
    public i18n: I18NService,
    public router: Router,
    public route: ActivatedRoute,
    public titleService: TitleService,
    public pageService: PageService,
  ) {
    super(pageService)
  }

  ngOnInit() {
    this.detailData = this.riskControlScheme
    this.initFirstColumns()
    this.initColumns()
  }

  initFirstColumns(): void {
    this.firstColumns = [
      {
        span: 4,
        index: 'schemeCode',
        label: '风控方案代码',
      },
      {
        span: 6,
        index: 'schemeName',
        label: '风控方案名称',
      },
      {
        span: 6,
        index: 'remark',
        label: '方案描述',
      },
      {
        span: 4,
        index: 'category',
        label: '风控方案类型',
      },
      {
        span: 4,
        index: 'insCode',
        label: '归属机构',
      },
    ]
  }
}
